
alter table Users add PhotoDirectory uniqueidentifier

alter table Users add PhotoProfile uniqueidentifier

alter table Countries add IdLanguage varchar(2)

alter table Users add Nationality varchar(200)

ALTER TABLE [dbo].[Users] drop CONSTRAINT [DF_Users_DisplayInContactRequests]  

alter table users drop column displayInContactRequests

alter table establishments add City varchar(200)

alter table [dbo].[UsersLearnLanguages] add displayInContactRequests bit default (1)

alter table establishments alter column IdCountry varchar(2) not null

ALTER TABLE establishments ADD CONSTRAINT FK_Establishments_Country FOREIGN KEY (IdCountry) REFERENCES Countries(IdCountry)

set IDENTITY_INSERT establishments ON
insert into establishments(IdEstablishment, LblEstablishment, IdCountry, DateCreate, TimeZone, City)
values (1, 'Etablissement test fr', 'fr', getdate(), 1, 'Paris')

insert into establishments(IdEstablishment, LblEstablishment, IdCountry, DateCreate, TimeZone, City)
values (2, 'Etablissement test es', 'es', getdate(), 1, 'Madrid')

insert into establishments(IdEstablishment, LblEstablishment, IdCountry, DateCreate, TimeZone, City)
values (3, 'Etablissement test uk', 'uk', getdate(), 1, 'London')
set IDENTITY_INSERT establishments ON

update users set idEstablishment = 1 where idCountry = 'fr'

update users set IdEstablishment = 2 where IdCountry = 'es'

update users set IdEstablishment = 3 where IdCountry = 'uk'

ALTER TABLE users ADD CONSTRAINT FK_Users_Establishments FOREIGN KEY (IdEstablishment) REFERENCES Establishments(IdEstablishment)

alter table users add ScholarLevel varchar(200) null

